package com.dede.locallib;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * 反射调用Android Log 方法
 *
 * @author hsh
 * @since 2018/2/1 11:40.
 */
public class ALog {

    private static Class<?> sLogClass;

    static {
        try {
            sLogClass = ReflectUtil.clazz("android.util.Log");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }

    public static void i(String tag, String msg) {
        try {
            Method method = sLogClass.getMethod("i", String.class, String.class);
            method.invoke(null, tag, msg);
        } catch (NoSuchMethodException |
                IllegalAccessException |
                InvocationTargetException e) {
            e.printStackTrace();
        }
    }

}
